<?php
require_once 'connexion (2).php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

$id3=null;
                                          
if(!(isset($_GET["id"])))
{
          die("Parametre 'id' absent");
}else{
          $id3=$_GET["id"];
												}
?>
<?php


?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <link rel="stylesheet" href="feuilledestyle.css">
        <link rel="stylesheet" href="menuHead/jquery.cleditor.css">
        <link href="menu2/styles.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="ajax/detail.js">
            
        </script>
    </head>
    <body vlink="blue">
        <div id="page">
        <?php include 'header.php';?>
        <div id="cadre">
        <?php include 'menu.php';?>  
            <br/>
            <FORM style="float:left; margin-top: 20px; background-color: orange; "> <INPUT TYPE="button" VALUE="Retour" onClick="history.back()"> </FORM> 
                 <div class="centre">
                      <a href="infoEntreprise.php?id=<?php echo $id3; ?>"><img class="retour" title="retour" src="img/imgretour.jpg" width="44px"/></a>
                          
                             <h3  style="margin-bottom: 124px;" >Les Offres de l'entreprise </h3>
                          
                          <br>
                          <a href="ajouterOffre.php?action=ajouter" target="_blank">Ajouter</a>
                            <table border="12" style="margin-left: aut; background-color:#CCC; margin-right: aut;  color: slategray; /*-moz-background-clip:*/ max-width:600px;">
                                
                                <tr style="margin-left: auto; margin-right: auto; color: slategray;">
                                    <th>Entreprise</th>
                                    <th>Période Début</th>
                                    <th>Période Fin</th>
                                    <th>Formation</th>
                                    <th>Mail</th>
                                    <th>Etat</th>
                                </tr>
				<?php
                                 
                                  $id3=null;
                                          
                                          if(!(isset($_GET["id"])))
                                          {
                                                    die("Parametre 'id' absent");
                                          }else{
                                                    $id3=$_GET["id"];
												}

                                
                                        $req_os="select * from entreprise as en, stage as s, formation as f where 
					 en.IDENTREPRISE=s.IDENTREPRISE and f.IDFORMATION=s.IDFORMATION and s.IDENTREPRISE=".$id3;
					$connexion->exec("SET CHARACTER SET utf8");											  
																			  
					$resu_=$connexion->query($req_os);
												  
                                                while($rep=$resu_->fetch(PDO::FETCH_ASSOC))
                                                        {
                                                 $idS=$rep["IDSTAGE"];
                                                 $NOME=$rep["NOMENTREPRISE"];
                                                 $DDS=$rep["DATEDEBUT"];
                                                 $DFS=$rep["DATEFIN"];
                                                 $LBF=$rep["LIBELLEFORMATION"];
                                                 $MAIL=$rep["MAILENTREPRISE"];
                                                 $ETAT=$rep["ETATSTAGE"];
                                                 $et= $ETAT;

                                       echo ' <tr style="margin-left: auto; margin-right: auto; color: dimgrey;">
                                            <td>'.$NOME.'</td>
                                            <td>'.$DDS.'</td>
                                            <td>'.$DFS.'</td>
                                            <td>'.$LBF.'</td>
                                            <td>'.$MAIL.'</td>
                                            <td>'.$et.'</td>
                                            <td><input type="button" name="IDs" onClick="envoyerRequete('.$idS.');" value="Détails"></td>
                                            <td><a href="ajouterOffre.php?idstage='.$idS.'&action=modifier"><img src="img/images.jpg" title="modifier" width="15px" height=""></td>
                                            </tr>';
                                                      
                                                }	
                                                ECHO " </table> ";
                                           
								?>
                               <h6 id='sujet'></h6>
                           
                      
                       
                 </div> 
            
            
            
            <?php
            //commente
                          if($DDS) {}else if ($statut1 == "professeur")
			   {?>
            
            
            
            
             <?php
                           }else if ($statut1 == "eleve")
			   {?>
            
            
            
            
             <?php
                           }else if ($statut1 == "maitredestage")
			   {?>
            
            
            
        <?php } require_once 'pied.php';?> 
        </div> 
    </div>
    </body>
</html>
